#@token()
<input type="hidden" class="layui-input" id="orderId" name="purchaseOrder.orderId" value="#(purchaseOrder.order_id??)"/>
<div class="layui-row layui-col-space1 task-row">
	#@colStart("供应商",6)
	<input id="supplierId" type="hidden" class="layui-input" placeHolder="必填" name="purchaseOrder.supplierId" value="#(purchaseOrder.supplier_id??)"/>
	<input id="supplierName" type="text" class="layui-input" placeHolder="必填" name="purchaseOrder.supplierName" value="#(purchaseOrder.supplierName??)"/>
	#@colEnd()
	#@colStart("起单人",6)
	<input id="originator" type="hidden" placeHolder="必填" class="layui-input" name="purchaseOrder.originator" value="#(purchaseOrder.originator??)" />
	<input id="originatorName" type="text" placeHolder="必填" class="layui-input" name="purchaseOrder.originatorName" value="#(purchaseOrder.originatorName??)" />
	#@colEnd()
</div>
<div class="layui-row layui-col-space1 task-row">
	#@colStart("经手人",6)
	<input type="hidden" class="layui-input layui-disabled" name="purchaseOrder.hander" value="#(purchaseOrder.hander??)" readonly/>
	<input type="text" class="layui-input layui-disabled" name="purchaseOrder.handerName" value="#(purchaseOrder.handerName??)" readonly/>
	#@colEnd()
	#@colStart("确认人",6)
	<input type="hidden" class="layui-input layui-disabled" name="purchaseOrder.confirmer" value="#(purchaseOrder.confirmer??)" readonly/>
	<input type="text" class="layui-input layui-disabled" name="purchaseOrder.confirmerName" value="#(purchaseOrder.confirmerName??)" readonly/>
	#@colEnd()
</div>
<div class="layui-row layui-col-space1 task-row">
	#@colStart("起单时间",6)
	<input id="originatTime" type="text" lay-verType='tips' class="layui-input" name="purchaseOrder.originatTime" value="#(purchaseOrder.originat_time??)" />
	#@colEnd()
	#@colStart("计划到货时间",6)
	<input id="planTime" type="text" lay-verType='tips' class="layui-input" name="purchaseOrder.planTime" value="#(purchaseOrder.plan_time??)" />
	#@colEnd()
</div>
<div class="layui-row layui-col-space1 task-row">
	#@colStart("实际到货时间",6)
	<input id="actualTime" type="text" lay-verType='tips' class="layui-input" name="purchaseOrder.actualTime" value="#(purchaseOrder.actual_time??)" />
	#@colEnd()
	#@colStart('结账方式',6)
	<input name="purchaseOrder.settleWay" type="radio" value="1" title="现结"
		   #if(purchaseOrder.settle_way??==1||purchaseOrder??==null)checked="checked"#end/>
	<input name="purchaseOrder.settleWay" type="radio" value="0"  title="月结"
		   #if(purchaseOrder.settle_way??==0)checked="checked"#end/>
	#@colEnd()
</div>
<div class="layui-row layui-col-space1 task-row">
	#@colStart("总计金额",6)
	<input type="text" lay-verType='tips' class="layui-input" name="purchaseOrder.totalAmount" value="#(purchaseOrder.total_amount??)" />
	#@colEnd()
	#@colStart("是否含发票",6)
	<input name="purchaseOrder.containBill" type="radio" value="1" title="是"
		   #if(purchaseOrder.contain_bill??==1||purchaseOrder??==null)checked="checked"#end/>
	<input name="purchaseOrder.containBill" type="radio" value="0"  title="否"
		   #if(purchaseOrder.contain_bill??==0)checked="checked"#end/>
	#@colEnd()
</div>
<div class="layui-row layui-col-space1 task-row">
	#@colStart("税率",6)
	<input type="text" lay-verType='tips' class="layui-input" name="purchaseOrder.taxRate" value="#(purchaseOrder.tax_rate??)" />
	#@colEnd()
	#@colStart('单据状态',6)
	<select name="purchaseOrder.status" class="layui-input" lay-search>
		<option value="">---请选择---</option>
		#for(data:orderStatusMap)
		<option value="#(data.key??)" #if(purchaseOrder	.status??==data.key) selected="selected" #end>#(data.value??)</option>
		#end
	</select>
	#@colEnd()
</div>

#@submitButton2(3)

<!-- 时间控件 -->
#define layuiFunc()
    // 供应商输入框点击事件
    $("#supplierName").on('click',function () {
        openDialogReturn("收款方选择窗口","#(path)/erp/info/supplier/index",false,null,null,null,function (res) {
            var supplierId = res.supplierId;
            var supplierName = res.supplierName;
            $("#supplierId").val(supplierId);
            $("#supplierName").val(supplierName);
        });
    })
	// 起单人输入框点击事件
    $("#originatorName").on('click',function () {
        openDialogReturn("支付方选择窗口","#(path)/portal/core/sysUser/index",false,null,null,null,function (res) {
            var userCode = res.userCode;
            var userName = res.userName;
            $("#originator").val(userCode);
            $("#originatorName").val(userName);
        });
    })

    laydate.render({
        elem: '#originatTime',
        type: 'datetime'
    });
    laydate.render({
        elem: '#planTime',
        type: 'datetime'
    });
    laydate.render({
        elem: '#actualTime',
        type: 'datetime'
    });

#end